import requests
import re
for i in range(0,100000,10):

    url = f'https://www.dongchedi.com/motor/pc/car/rank_data?aid=1839&app_name=auto_web_pc&city_name=%E9%A6%99%E6%B8%AF&count=10&offset={i}&month=&new_energy_type=&rank_data_type=11&brand_id=&price=&manufacturer=&series_type=&nation=0'
    res = requests.get(url)
    if res.status_code == 200:
        datas = res.json()['data']['list']
        p = i
        for i in datas:
            p = p+ 1
            name = i['series_name']
            price = i['price']
            detail_urls = f'https://www.dongchedi.com/auto/series/{i['series_id']}'
            print(name, price, detail_urls,p)
            res2 = requests.get(detail_urls)
            print(res2.text)
            c_url = re.search(r'class="actual_config-link__zzoRY tw-border-1 tw-text-12 lg:tw-text-14 tw-z-2" href="(.*?)">查看完整实测内容<i ',res2.text).group(1)
            # c_url = f"https://www.dongchedi.com{c_url}"
            p_url = re.search(r'<a class="actual_config-link__zzoRY tw-border-1 tw-text-12 lg:tw-text-14 tw-z-2" href="(.*?)">查看完整实测内容',res2.text).group(1)
            p_url = f''
            print(c_url)
            break
    break